<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/4/30
 * Time: 11:00
 */
//载入函数库
include './Public/functionall.php';

//开启session
session_start();

//自动加载类
function __autoload($cname){
//    判断，加载的是控制类还是工具类
    if(substr($cname,-10)=='Controller'){
//        加载控制类
        include "./Controller/{$cname}.php";
    }else{
//        加载工具类
        include "./Tools/{$cname}.php";
    }
}

//处理控制类参数
$c = isset($_GET['c'])?$_GET['c']:'Index';
$c = "{$c}Controller";
$c = ucfirst($c);
//实例化一个类的对象
$controller = new $c();

//处理方法参数
$a = isset($_GET['a'])?$_GET['a']:'index';
//调用方法
$controller->$a();